﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.Primitives
{
    public class PrimitiveNConnect : Primitive
    {

        #region Attributs d'instance de classe

        private string adresseSource;
        private string adresseDestination;
        private string adresseReponse;

        #endregion

        private PrimitiveNConnect(Primitives primitive, string adresseSource, string adresseDestination, string adresseReponse)
        {
            this.primitive = primitive;
            this.adresseSource = adresseSource;
            this.adresseDestination = adresseDestination;
            this.adresseReponse = adresseReponse;
        }

        #region Propriétés

        public string AdresseSource { get { return adresseSource;  } }
        public string AdresseDestination { get { return adresseDestination; } }
        public string AdresseReponse { get { return adresseReponse; } }

        #endregion

        #region Méthodes de création d'instance

        static public PrimitiveNConnect CreateNConnectReq(string adresseSource, string adresseDestination)
        {
            return new PrimitiveNConnect(Primitives.NConnectRequest, adresseSource, adresseDestination, string.Empty);
        }
        static public PrimitiveNConnect CreateNConnectInd(string adresseSource, string adresseDestination)
        {
            return new PrimitiveNConnect(Primitives.NConnectIndication, adresseSource, adresseDestination, string.Empty);
        }
        static public PrimitiveNConnect CreateNConnectResp(string adresseReponse)
        {
            return new PrimitiveNConnect(Primitives.NConnectResponse, string.Empty, string.Empty, adresseReponse);
        }
        static public PrimitiveNConnect CreateNConnectConf(string adresseReponse)
        {
            return new PrimitiveNConnect(Primitives.NConnectConfirmation, string.Empty, string.Empty, adresseReponse);
        }

        #endregion
    }
}
